<%@ page import="fm.web.CurrentRequest" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 61741
  Date: 2018/1/21
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="modal fade" id="addDialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    添加轮播图
                </h4>
            </div>
            <div class="modal-body">
                <div>
                    <div class="form-group col-md-6">
                        <input type="text" value="" placeholder="点击选择时间范围" name="dateRange" id="dateRange"/>
                    </div>
                    <div>
                        <div class="form-group" id="areaSelectBox">
                            <label>投放区域</label>
                            <select name="city" id="city" class="chosen-select">
                                <option value="">--选择投放区域--</option>
                                <option value="default">默认全国</option>
                                <c:forEach items="${citys}" var="city">
                                    <option value="${city.addressId}">${city.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="clear"></div>
                        <div class="col-md-6">
                            <label>响应类型</label>
                            <select name="type" id="type" style="display: inline-block;width:10rem;"
                                    onchange="changeValueShow()">
                                <option value="LINK" selected>链接</option>
                                <option value="GOOD">商品</option>
                                <option value="ARTICLE">文章</option>
                            </select>
                        </div>
                        <div class="col-md-6" id="linkInputBox">
                            <input placeholder="请输入合法的链接" id="linkInput" type="text"/>
                        </div>
                        <div class="col-md-6" id="articleSelectBox">
                            <select id="articleSelect">

                            </select>
                        </div>
                        <div class="col-md-6" id="goodSelectBox">
                            <select id="carouselShopSelect" data-target="goodSelect" onchange="showShopGood(this)">
                                <option value="0">--请选择店铺--</option>
                            </select>
                            <br/>
                            <select id="goodSelect">
                                <option value="0">--选择店铺后选择商品--</option>
                            </select>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="clear"></div>
                <div>
                    <div class="form-group upload-img-box">
                        <label>选择图片</label>
                        <img id="preveiw1" name="preveiw1" class="img_upload_preview" for="upfile" data-target="img1"
                             src=""
                             onclick="$('#upfile').click()"
                             onerror="this.src='${ctx}/resources/ueditor/dialogs/image/images/image.png'"/>
                        <input id="upfile" type="file" name="upfile" style="display: none;"
                               onchange="uploadFile('upfile','preveiw1','uri','image')"/>
                        <input name="uri" id="uri" type="hidden">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消
                </button>
                <button type="button" class="btn btn-primary" onclick="addCarousel()">
                    提交
                </button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="shopSelectDialog" tabindex="-1" role="dialog" aria-labelledby="shopLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="shopLabel">
                    选择店铺
                </h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label>认证店铺</label>
                    <select id="shopSelect">
                    </select>
                </div>
                <%--<div class="form-group">--%>
                    <%--<label>投放区域</label>--%>
                    <%--<select name="city" id="shopAreaSelect" class="chosen-select">--%>
                        <%--<option value="default">默认全国</option>--%>
                        <%--<c:forEach items="${citys}" var="city">--%>
                            <%--<option value="${city.addressId}">${city.name}</option>--%>
                        <%--</c:forEach>--%>
                    <%--</select>--%>
                <%--</div>--%>
            </div>
            <input type="hidden" name="shopFlagType" id="shopFlagType"/>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消
                </button>
                <button type="button" class="btn btn-primary" onclick="flagShop('ADD')">
                    提交
                </button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="articleSelectDialog" tabindex="-1" role="dialog" aria-labelledby="articleLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="articleLabel">
                    选择文章
                </h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label>选择文章</label>
                    <select id="articleSelector">
                    </select>
                </div>
                <div class="form-group">
                    <label>文章封面</label>
                    <img id="img-preview" name="img-preview" class="img_upload_preview"
                         for="img-file" data-target="img-val" src=""
                         onclick="$('#img-file').click()"
                         onerror="this.src='${ctx}/resources/ueditor/dialogs/image/images/image.png'"/>
                    <input id="img-file" type="file" name="img-file" style="display: none;"
                           onchange="uploadFile('img-file','img-preview','portal_img','image')"/>
                    <input name="portal_img" id="portal_img" type="hidden">
                    <div class='alert alert-warning' id="picsize"></div>
                    <input type="hidden" name="pagetype" id="pagetype"/>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消
                </button>
                <button type="button" class="btn btn-primary" onclick="doFlagArticle('ADD')">
                    提交
                </button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="goodAddDialog" tabindex="-1" role="dialog" aria-labelledby="shopLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="goodLabel">
                    添加平台推荐商品
                </h4>
            </div>
            <div class="modal-body">
                <div>
                <div class="form-group col-md-6">
                    <label>商户</label>
                    <select value="" data-target="newgoodSelect" class="shopSelect" id="newgoodShopSelect" onchange="showShopGood(this)">
                        <option value="">请选择</option>
                    </select>
                </div>
                <div class="form-group col-md-6">
                    <label>商品选择</label>
                    <select id="newgoodSelect">
                    </select>
                </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消
                </button>
                <button type="button" class="btn btn-primary" onclick="addGood($('#newgoodSelect').val(),'ADD','default')">
                    提交
                </button>
            </div>
        </div>

    </div>
</div>
